package com.qf.controller;

import org.springframework.util.AntPathMatcher;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/path")
public class PathController {

    @GetMapping("/url")
    public String url(HttpServletRequest request){
        String requestURI = request.getRequestURI();
        StringBuffer requestURL = request.getRequestURL();

        System.out.println("uri:"+requestURI);
        System.out.println("Url:"+requestURL);

        AntPathMatcher antPathMatcher = new AntPathMatcher();
        boolean match = antPathMatcher.match("/cross/path/**", requestURI);
        System.out.println(match);


        return "ok";
    }
}
